#include <stdio.h>
#include <string.h>
int main() {
    char str[100], *p, *q;
    printf("请输入字符串：");
    gets(str);
    p = str;
    while (*p != '\0') {
        if (*p == 'f' && *(p + 1) == 'o' && *(p + 2) == 'o') {
            *p = 'x';
            *(p + 1) = 'x';
            *(p + 2) = 'x';
            p += 3;
        } else {
            p++;
        }
    }
    printf("替换后：%s\n", str);
    return 0;
}